home *** CD-ROM | disk | FTP | other *** search
/ Assassins - Ultimate CD Games Collection 1 / Assassins - Ultimate CD Games Collection (1994)(Weird Science)(Track 1 of 2)[!][Amiga-CD32-CDTV][CDD5332].iso / instructions / quizzes / rummy < prev    next >
Text File  |  1992-09-02  |  24KB  |  474 lines

  1. FILE: RUMMY.DOC
  2.                                 Rummy v1.00
  3.  
  4.                               By Simon Preene
  5.  
  6.                       Copyright Amiga Computing, 1990
  7.  
  8. Contents
  9.     Introduction
  10.     Requirements
  11.     Rules
  12.     Scoring
  13.     Screen Layout
  14.     Use Of The Program (short tutorial)
  15.     Modes Of Play
  16.     Reference
  17.     Description Of Source Code
  18.  
  19.  
  20. Introduction.
  21.  
  22.     This text file contains the instructions for and some notes on the 
  23. operation of Rummy. The program is designed to play the card game of 
  24. Rummy. I have played a number of variations of this game (variously 
  25. called Rummy, Gin-Rummy, or Sets), but they all have the same basic 
  26. objective: the collection of sets of cards which share some property. A 
  27. more detailed description of the game rules is included in the Rules 
  28. section below.
  29.     To start the program either double-click on the rummy icon, or type 
  30. rummy at the shell prompt.
  31.  
  32. Requirements.
  33.  
  34.     The program consists of a single file on disk of about 80k in size, 
  35. and this contains all graphics and data needed by the program. Once 
  36. loaded the program appears to require about 160k. This is mainly used by 
  37. the three plane 640*200 screen. Consequently there should be no problem 
  38. running the game on an unexpanded A500.
  39.  
  40. Rules.
  41.  
  42.     This section explains how to play the card game; using the program is 
  43. explained below.
  44.     The game is for either two or three players. A game consists of a 
  45. number of rounds (or hands), the overall objective being to achieve a 
  46. score lower than that of the other competitors (see scoring). The defualt 
  47. number of rounds is seven, but this can be easily changed.
  48.     At the start of each round, seven cards are dealt to each player 
  49. taking part. The players take turns to go first (round 1 player 1,round 
  50. player 2...). After dealing the top card of the pack is turned over to 
  51. form what will be referred to as the face up pile of cards, and the 
  52. remaining cards are placed to the left of this, face down, to form the 
  53. face down pile.
  54.     The objective in each round is for the players to get rid of 
  55. all their cards by forming sets of three or more cards and submitting them,
  56. or by adding cards to sets which have already been submitted. Sets for 
  57. submission must consist of 3,4,5,6, or 7 cards which share some common 
  58. property, for example they may have the same number (such as 3diamonds,    
  59. 3clubs, 3spades) (these are referred to as numsets in the coding), or 
  60. they may be a run of cards of the same suit (e.g. 5clubs, 6clubs, 7clubs) 
  61. (these are referred to as suitsets in the coding). For sets of the same 
  62. suit the ace can come before the two or after the king.
  63.     Cards to be added to an existing set must continue the progression of 
  64. cards already in the set. For example 3c (c means clubs, etc for d,s,h) 
  65. could be added to a set of 3d-3h-3s or 4c-5c-6c, but not to 5d-5s-5h 
  66. or 4d-5d-6d. The following lists some other examples
  67.  
  68.     SET                                      POSSIBLE ADDITIONS
  69.     
  70. 1.    jd-qd-kd                                 10d,ad
  71. 2.    ad-ac-as                                 ah
  72. 3.    2h-3h-4h-5h                              ah,6h
  73.     
  74.     It is possible to add more than one card at a time, so if a player 
  75. had the 9d and 10d, then both could be added to the set 1 above. For sets 
  76. of the same suit, cards can be added to either end. Any number of valid 
  77. additions can be made to any number of sets while it is a players turn. 
  78. However a player can only add or submit cards when it is his turn, and 
  79. not when it is that of another player.
  80.     If a player cannot get rid of all his cards when it is his turn then 
  81. he has the option to exchange one of them for another card in one of the 
  82. following ways :
  83.  
  84. 1. Take the card on the current face up pile, and replace it with one of 
  85.    his own cards which is of no use;
  86. 2. Take the card on the current face down pile, and place one of 
  87.    his own cards which is of no use on the face up pile;
  88. 3. If after seeing the face down card it is thought to be of no use, he 
  89.    may place this on the face up pile.
  90.    
  91.     Any one of the above can be chosen, but after seeing the face down 
  92. card it is only possible to take it in exchange for another, or put it 
  93. directly on the face up pile:  i.e. the face up card is no longer 
  94. available.
  95.     After one of these actions has been taken the player has a second 
  96. opportunity to add or submit cards if this is possible.
  97.     If the player still has cards left at the end of his turn, the next 
  98. player then takes a turn and so on until one player has no cards left. 
  99. When this happens, the players' scores are updated based on how many 
  100. cards they have left and the round is over.
  101.  
  102. Scoring.
  103.  
  104.     The scores are updated at the end of each round by adding the value 
  105. of the cards held by the player together and adding that to his current 
  106. score. For this purpose the cards are valued as one to thirteen for the 
  107. cards ace,2,3,...,10,jack,queen,king. The player with the lowest score 
  108. after all rounds have been played is the winner.
  109.  
  110. Screen Layout
  111.  
  112.     In the top left corner of the screen are two piles of cards, the left 
  113. of which is referred to as the face down pile, and the right the face up 
  114. pile. When the program starts both are face down (showing the reverse of 
  115. a card). During a game the right will show a card face. Just to the 
  116. right of this is an area in which messages are displayed explaining what 
  117. is happening, e.g. the next players name, what that player has done, 
  118. whether operations completed successfully or not etc. There is also a 
  119. gadget controlling the number of rounds in a game (see below for how to 
  120. change this). The continue gadget also appears here.
  121.     Below the two packs are the status areas for each of the three 
  122. players. These consist of the cards the player is holding, which may be 
  123. face up or down during a game, but are blank initially since no game is 
  124. in progress. To the right of these are five pieces of information about 
  125. each player. The player's name is in a red box; this is a gadget allowing 
  126. the player's name to be changed. Other information is the value of the 
  127. player's hand (not displayed if the player's cards are not on 
  128. view), which is the amount which will be added to the score should that 
  129. player lose before getting another turn. The number of wins that player 
  130. has had, and the current score are also shown. The number of turns taken 
  131. appear last. Player one's data is at the top, then player two, and 
  132. finally player three.
  133.     On the far right of the screen are the face up sets which have been 
  134. submitted by the players. This area of the display is managed so that the 
  135. display of sets does not overflow into the rest of the display. For this 
  136. reason when new sets are submitted or additions made to existing sets, 
  137. the order in which the sets appear may change.
  138.  
  139. Use of the Program.
  140.  
  141.     This section describes an example game using the default settings.
  142.     The program can be started from either the Workbench or the shell.
  143. From the shell, typing rummy executes the program. 
  144.     When the program starts it opens its own screen and displays some
  145. initial information together with a message inviting the user to "use menus
  146. to play". The menus are described in detail below, but for now use the 
  147. project menu to select the play submenu, and then the Three player game. 
  148. Seven cards will then be dealt to each of the three players. Those of 
  149. player one (user) will be visible to you, those of Lisa and Mike will be 
  150. face down. The face up pile will now have its top card overturned.
  151. It is initially your turn (user appears on line two, and the pointer has 
  152. a 1 under it, signifying player one).
  153.     The cards of your hand will be sorted into ascending order, by number 
  154. within suit (see Reorder option below to change the display order). At 
  155. this point, if you can identify a set of three or more cards in your 
  156. hand, you may submit it now. To do this select each member of the 
  157. set (it will then be complemented to grey). If you select a card 
  158. which is not in the set, deselect it by clicking on it again with the 
  159. mouse. Once each member of the set is selected, click on the "submit new 
  160. set" gadget. At this point, if the selected cards form a valid set they 
  161. will be removed from your hand and displayed as a "face up set" on the 
  162. right side of the screen; if on the other hand they do not form a valid 
  163. set the selected cards will remain your hand of cards, still selected. At 
  164. this point you should check that
  165.  
  166.     1. All selected cards form a SINGLE valid set
  167.     2. At least three cards are selected
  168.  
  169. You may have selected a card which is not part of the set; if so deselect 
  170. it and try again. As yet there will be no existing sets, so addition is 
  171. not possible.
  172.     After submitting any sets (or before if you like) if you have any 
  173. cards left in your hand you must make an exchange, which is one of the 
  174. three action detailed in the Rules section above. The methods are as 
  175. follows:
  176.  
  177. 1. To take the face up card: select it with the mouse so that it has a 
  178. box  around it; then select the card from your hand which you want to 
  179. drop. The exchange then takes place.
  180. 2. To take the face down card or take no card: select facedown card and it will
  181. be turned face up. Then to take this card select the card you want to drop 
  182. and the exchange occurs; or to take no card select the face up pile (the 
  183. right hand one) and the card from the face down pack (which is now face 
  184. up) will be copied to the face up pack, and the face down pack is once 
  185. again displayed as the reverse of a card.
  186.  
  187. Whichever of these actions is taken, a message appears asking the 
  188. player to click on the continue gadget to go on. At this point, either do 
  189. this for the next player to have his turn, or you may submit further 
  190. sets, as described before.
  191.     Pressing continue before an exchange has been made will display a 
  192. message telling you that no exchange has been made; so make one before 
  193. selecting the gadget again.
  194.     When you legitimately press continue, the pointer becomes a 2, and 
  195. the player name on line two becomes Lisa. You may at 
  196. this point see a message "... is thinking", depending on the complexity 
  197. of the situtation. When a move has been decided upon a message appears 
  198. informing you of which pile the card was taken from, and the number of 
  199. cards submitted. When you have read this hit continue again, and it will 
  200. become Mike's turn. After he has made a move a short description is again 
  201. displayed, and pressing continue again means it is your turn again.
  202. See reference section for details of how to add cards to existing sets.
  203.     This cycle continues until one player has no cards left, at which 
  204. point the end of round requester appears to announce the winner. This 
  205. lists how many points each player has, the number of rounds in the game 
  206. and the number of the round just completed, and then waits for you to select
  207. its 'proceed' gadget, when the next round will begin as before, if any 
  208. remain in the current game. If not the end of game requester appears to 
  209. announce which player has won the overall game. Selecting proceed from 
  210. here will return the program to its initial state, from where another 
  211. game can be started.
  212.  
  213. --------------------------------------------------------------------------
  214.  
  215. Modes Of Play
  216.  
  217.     The program has been designed to allow various combinations of human and
  218. AutoPlayers to compete, of which the following is a list
  219.  
  220.     3 human players
  221.     2 human players
  222.     3 AutoPlayers
  223.     2 AutoPlayers
  224.     2 human players with one AutoPlayer
  225.     1 human player with two AutoPlayers
  226.     1 human with 1 AutoPlayer
  227.  
  228. These various combinations are achieved using the SPECIAL->MANUAL CONTROL 
  229. submenu explained in the reference section below. When there is more than 
  230. one human player competing at the start of a round, in order that the 
  231. players have time to change places without cheating occuring, the program 
  232. will automatically wait for the continue gadget to be pressed before 
  233. showing the human players cards, by which time the previous player will 
  234. have turned away. As a further security measure, if when the player comes 
  235. to take his turn, the turn number shown is his status area is not the 
  236. same as it was at the end of his last turn, then the previous player must 
  237. have cheated by going around each player and looking at their cards. When 
  238. continue is selected the turn number is increased by 1.
  239.     The continuous play option (see below) is included for games with no 
  240. human players; although it can be used when there are some, doing so 
  241. means that the players will not be able to read the descriptions of what 
  242. the AutoPlayers are doing, and the round winners will not be announced.
  243.     Note that when games are played with more than one human player, all 
  244. of the viewcards menu items should be unchecked; the cards of each  of the 
  245. human players are then automatically displayed at the start of their turn,
  246. and then hidden again at the end.
  247.  
  248. --------------------------------------------------------------------------
  249.  
  250. Reference.
  251.  
  252.     This section gives details on how to perform actions in the game, and 
  253. on what the menus do.
  254.  
  255.     actions: Making an exchange
  256. When it is your turn, to take the face up card, click on it so that a box 
  257. appears around it, and then click on the card you want to drop.
  258. When it is your turn, to take the face down card, click on it so that a box
  259. appears around it, and then click on the card you want to drop.
  260. When it is your turn, to take no card, click on the face down card, and 
  261. then on the face up card to make the exchange. (Look at it first to see 
  262. if you want it.)
  263.  
  264.     Changing player names
  265. At any time, click on a player name gadget (the name with the box 
  266. around it) and edit it to the new name.
  267.  
  268.     Changing the number of rounds in a game. DEFAULT:7
  269. During a game click on the number of rounds gadget on line four and 
  270. edit it to a new number. Entering a number less than the current round 
  271. number will cause the game to end after the completion of the current 
  272. round.
  273.  
  274.     Submitting a set
  275. When it is your turn, select the cards which form a set (according to the 
  276. rules described above) and then click on the "submit new set" gadget on 
  277. the right of the screen. If the cards selected form a valid set they will 
  278. be removed from your hand and displayed on the right of the screen. If 
  279. they do not form a valid set, you will know this because the cards will 
  280. remain selected in your hand and will not appear in the sets area. This 
  281. means that either there were less than three cards selected (at least 
  282. this many are needed for submission) or one or more of the selected cards 
  283. does not fit in with the rest. You should then check which cards are 
  284. selected, and try again after making any changes. YOU CAN ONLY SUBMIT ONE 
  285. SET AT A TIME. If you have the cards 3d-4d-5d-9d-9h-9s-9c, selecting them 
  286. all at once for submission will not work. You must select the 3-4-5, 
  287. press submit gadget, then select 9-9-9-9 and press the submit gadget 
  288. again to win.
  289. ***** The program has now been updated to display a message telling the 
  290. player whether or not the submission was accepted.
  291.  
  292.     Adding to a set
  293. When it is your turn, select the cards you want to add to a single set, 
  294. in any order, and to add to a set of cards of the same suit you can select 
  295. cards to add at both ends all in one go. After this select the set you want to 
  296. add them to by clicking on one of the cards in the set. Now any selected cards 
  297. which can be added to that set will be removed from your hand and added to
  298. the set; any highlighted cards in your hand will return to normal. If no
  299. highlighted cards could be added to the set the will remain highlighted
  300. in the hand of the player. Any number of cards can be added to a set.
  301. ***** The program has now been updated to display a message to tell the 
  302. player whether or not any of the selected cards were added to the 
  303. selected set.
  304.  
  305. All other actions are carried out through menu options described below.
  306.  
  307. PROJECT->PLAY->
  308.     This submenu allows either a two or a three player game to be started 
  309. or ended. The end game option is active only during a game, and the start 
  310. game options are active only when no game is in progress.
  311.     When the exit game option is selected, a message appears in the title 
  312. bar asking you to verify your choice with the verification menu. Either 
  313. select the verify menu item to confirm, or reselect the exit game item on 
  314. this menu to cancel. Normal play can continue throughout.
  315.  
  316. PROJECT->REORDER
  317.     This item allows the cards of the current player's hand to be 
  318. reordered. When selected, you are asked to select the players's cards in 
  319. the order they should appear from left to right. As the last card is 
  320. selected the cards are redisplayed in the new order.
  321.  
  322. PROJECT->ABOUT
  323.     Description of program.
  324.  
  325. PROJECT->QUIT
  326.     Exit program. This causes a message to appear in the title bar asking 
  327. you to select VERIFY->VERIFYQUITPROGRAM to confirm. Doing this will end 
  328. the current game (if in progress) and display the result, and then end 
  329. the program. Note: the request can be cancelled by reselecting the 
  330. PROJECT->QUIT option. Normal play can continue while the message is 
  331. present in the title bar.
  332.  
  333. INTELLIGENCE->                DEFAULT:4 for each player
  334.     This menu controls the characteristics of the AutoPlayers. There is 
  335. an intelligence setting for each player: level 1 is the easiest,
  336. and level 10 is the hardest. The level has no effect for players under
  337. manual control.
  338.  
  339. SPECIAL->VIEWCARDS
  340.     This submenu controls whether the cards of each player are always 
  341. visible; there is a subitem for each player which, if checked, means that 
  342. player's cards are always visible.
  343. NB: Changing these items only takes effect when the player concerned has 
  344. their next turn.
  345. NB: If a player is under manual control their cards are automatically 
  346. displayed when it is their turn, and only hidden if their viewcards
  347. item is unchecked.
  348.  
  349. SPECIAL->MANUAL DEAL
  350.     This item allows the player to select the cards for each player at 
  351. the start of the round. When selected, at the start of the round a 
  352. requester is displayed with every card in it. The number of the player 
  353. for whom the cards are currently being selected appears under the 
  354. pointer. Click on a card and it appears in that players hand. Click on it 
  355. again and it is removed. Once seven cards are selected no more can be 
  356. added. When you have selected all the cards for a player select ACCEPT to 
  357. select cards for the next player. After the cards for each player have 
  358. been selected, ACCEPT begins the game.
  359. NB: any number of cards upto seven may be dealt to a player.
  360. NB: the AUTODEAL gadget can be selected at any time to automatically deal 
  361. seven cards per player from a shuffled pack.
  362.  
  363. SPECIAL->MANUAL CONTROL
  364.     This submenu has items to determine whether each player is under 
  365. manual control or AutoPlayer control (checked means manual). Changes here 
  366. take effect at the begining of that player's next turn. Changes may be 
  367. made here at any time.
  368.  
  369. SPECIAL->MODIFYMEMORY
  370.     Each player has their own memory describing where they think that each
  371. card is. There is an entry for each card containing the following flags
  372.  
  373. CURRPLRHOLDS            Current player holds
  374. NEXTPLRHOLDS            Next player holds
  375. PREVPLRHOLDS            Previous player holds
  376. CURRPLRDROPD            Current player dropped
  377. NEXTPLRDROPD            Next player dropped
  378. PREVPLRDROPD            Previous player dropped
  379. INFUPSET                In face up set on right of screen
  380. GONEPAST                In face up Pack
  381.  
  382. The flags are used in the score function to decide which cards are likely 
  383. to still be available. The modify memory option allows you to change and 
  384. inspect the contents of each player's memory. Selecting card displays the 
  385. flags currently set for that card. At this point the gadgets can be used 
  386. to change the flags set for that card in the memory. When the changes 
  387. have been made use SAVE to store the changes before selecting another 
  388. card. After making all the changes you want to use ACCEPT exit the 
  389. requester and store the changes in the player's memory, or CANCEL to exit 
  390. and discard the changes.
  391. NB: Intelligence levels are partially implemented by randomly corrupting 
  392. player memory.
  393.  
  394. SPECIAL->OPENNEWPACK->
  395.     This submenu allows you to determine when the a new pack is opened, 
  396. after each hand is played or after each game, or not at all. This does 
  397. not have very much effect.
  398. NB: So far as I am aware there is no possibility of cards "disappearing", 
  399. but if you think that they are, then select AFTEREACHHAND from this menu.
  400.  
  401. SPECIAL->SHUFFLE->
  402.     This is similar to the previous option but controls when cards are 
  403. shuffled instead. Again it has little effect.
  404.  
  405. SPECIAL->CONTINUOUSPLAY
  406.     This option means that there is no delay after an AutoPlayer takes a 
  407. turn while continue is pressed, and the the round winner requester is not 
  408. displayed. I.e. if left playing with all players in AutoPlayer mode the 
  409. game will progress to completion on its own and the final result will be 
  410. displayed.
  411. ***** There appears to be an intermittent bug which causes players to 
  412. change themselves to manual control. It only appears rarely - I have only 
  413. seen it once.
  414.  
  415. VERIFY->
  416.     This contains the verification items for exiting a game and quitting 
  417. the program.
  418.  
  419. --------------------------------------------------------------------------
  420.  
  421. Description of source code
  422.  
  423.     The source code is contained in a number of modules so that  changes 
  424. are easier to make. There are seven C modules and two header files:
  425.  
  426.     C source
  427.         CARDDECL.C        graphics for cards
  428.         DECL.C            data declarations
  429.         MENUS.C            menu declaraions
  430.         GAME.C            main program, exception handler, open libraries etc.
  431.         PLAYGAME.C        main game loop and associated functions
  432.         TURN.C            functions to allow the user to take a turn
  433.         AUTOTURN.C        functions to allow the AutoPlayers to take a turn
  434.  
  435.     C headers
  436.         DEFNS.H            structure templates, #DEFINE constants and macros
  437.         EXTERNS.H        externally visible objects (including function 
  438. prototypes)
  439.  
  440.     The code was developed and compiled using Lattice Cv5.05, with the 
  441. following compiler options: -cfist -v -y -oram: -L. The last of which 
  442. invokes the linker automatically.
  443.     Most of the code is (or was) fairly well structured, apart from the
  444. AUTOTURN.C functions which underwent many ammendments during development.
  445.     So far as I am aware there are not any bugs left in the code which 
  446. cause a system crash. Most (see below) of the quirks in the machine's
  447. gameplay appear to have been removed.
  448.  
  449. * One bug appears to remain, which means there is a chance that when three 
  450. AutoPlayers play together with each of them being on level 10 and each of 
  451. them has a single card left, a situation may arrise where each player 
  452. takes the faceup card each time, and drops the card they selected last 
  453. time (since it is the only one they hold). As a result the same cards 
  454. keep going around each player. If this happens simply take manual control 
  455. of any one player, when it is their turn select the face down card; then 
  456. return control to AutoPlayer. This  cannot happen when a human is 
  457. playing, neither can it happen when any one player is on less than level 
  458. 10 since in that case a random decision is bound to be used eventually.
  459. As mentioned, this does not affect games with any human competitors .
  460.  
  461. ****** When the program first starts running you may see a window open 
  462. and then close on the WorkBench screen. This window seems to open 
  463. automatically when the program is run from the icon, and does not happen 
  464. when the shell is used. Using Iconx only creates further problems. The 
  465. only way I have found to remove the problem is to fclose() both stdin and 
  466. stdout, which is what the program now does.
  467.  
  468. Note that when viewing the source code, tab stops should not be larger 
  469. than four characters, otherwise much of the code disappears off the right 
  470. of the screen.
  471.  
  472.  
  473. Coding and Graphics by Simon Preene, July - October 1990
  474.